import { observable, action } from 'mobx'
import { lazyRoutes } from "../../tools/lazyRoutes"




export default class RouteMap {
  @observable Maps = lazyRoutes([
    {
      path: "/cacheRoute/detail/:id",
      component: () => import("../../pages/cacheRoute/article"),
      name:"cacheRouteDetail"
    },
    {
      path: "/cacheRoute/list",
     cache:true, //需要测试路由缓存请开启
      component: () => import("../../pages/cacheRoute/scroller")
    }
  ]);
  
  constructor() {}
  @action.bound
  setCache(path,cache){
      this.Maps.map((item)=>{
          if(item.path==path){
            item.cache=cache;
          }
          return item;
      })
      
  }
}
